home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #43 (Apr 89) / Designer CDEF Code / AboutDialog.Pas next >
Pascal/Delphi Source File  |  1989-01-06  |  2KB  |  48 lines

  1. UNIT AboutDialog;
  2.  
  3. {File name:AboutDialog.Pas   }
  4. {Function: Handle a dialog}
  5. {History: 12/19/88 Original by Prototyper.   }
  6. { Modified 1/6/89                      }
  7.  
  8. INTERFACE
  9.  
  10.  
  11.     PROCEDURE D_AboutDialog;
  12.  
  13. IMPLEMENTATION
  14.  
  15.     CONST                                 {These are the item numbers for controls in the Dialog}
  16.         I_OK = 1;
  17.  
  18.     VAR
  19.         ExitDialog : boolean;               {Flag used to exit the Dialog}
  20.     PROCEDURE D_AboutDialog;
  21.         VAR
  22.             GetSelection : DialogPtr;         {Name of dialog}
  23.             itemHit : Integer;                {Get selection}
  24.  
  25.     BEGIN                               {Start of dialog handler}
  26.         GetSelection := GetNewDialog(2, NIL, Pointer(-1)); {Bring in the dialog resource}
  27.         ShowWindow(GetSelection);         {Open a dialog box}
  28.         SelectWindow(GetSelection);       {Lets see it}
  29.         SetPort(GetSelection);            {Perpare to add conditional text}
  30.  
  31.         ExitDialog := FALSE;                {Do not exit dialog handle loop yet}
  32.  
  33.         REPEAT                            {Start of dialog handle loop}
  34.             ModalDialog(NIL, itemHit);      {Wait until an item is hit}
  35.         {Handle it real time}
  36.             IF (ItemHit = I_OK) THEN         {Handle the Button being pressed}
  37.                 BEGIN
  38.                     ExitDialog := TRUE;             {Exit the dialog when this selection is made}
  39.                 END;                          {End for this item selected}
  40.  
  41.  
  42.         UNTIL ExitDialog;                 {Handle dialog items until exit selected}
  43.  
  44.         DisposDialog(GetSelection);       {Flush the dialog out of memory}
  45.  
  46.     END;                                {End of procedure}
  47.  
  48. END.                                  {End of unit}